/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.Kernel;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.modeler.model.common.MetaTypedList;
import edu.pku.sei.modeler.model.xml.XMLUtility;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;
import edu.pku.sei.modeler.uml.util.MetaTypedSet;



/**
 * @generated
 * 
 * modified by zsjs
 *
 */
public class UMLPackage extends Namespace implements IUMLPackage {
	// attributes
	
	
	
	
	// references
	
	protected MetaTypedList ownedMember;
	
	protected MetaTypedList ownedType;
	
	protected MetaTypedList packageMerge;
	
	protected MetaTypedList nestedPackage;
	
	
	
	// getters & setters for attributes
	
	// getters for references
	//modified by zsj to change PackageableElement to IPackageableElement
	public MetaTypedList getOwnedMember() {
		if(ownedMember == null) {
			ownedMember = new MetaTypedSet(IPackageableElement.class, this, ModelPackage.UMLPACKAGE_OWNEDMEMBER);
		}
		return ownedMember;
	}
	
	public MetaTypedList getOwnedType() {
		if(ownedType == null) {
			ownedType = new MetaTypedSet(Type.class, this, ModelPackage.UMLPACKAGE_OWNEDTYPE);
		}
		return ownedType;
	}
	
	public MetaTypedList getPackageMerge() {
		if(packageMerge == null) {
			packageMerge = new MetaTypedSet(PackageMerge.class, this, ModelPackage.UMLPACKAGE_PACKAGEMERGE);
		}
		return packageMerge;
	}
	
	public MetaTypedList getNestedPackage() {
		if(nestedPackage == null) {
			nestedPackage = new MetaTypedSet(UMLPackage.class, this, ModelPackage.UMLPACKAGE_NESTEDPACKAGE);
		}
		return nestedPackage;
	}
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		// references
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.UMLPACKAGE_OWNEDMEMBER, ownedMember);
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.UMLPACKAGE_OWNEDTYPE, ownedType);
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.UMLPACKAGE_PACKAGEMERGE, packageMerge);
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.UMLPACKAGE_NESTEDPACKAGE, nestedPackage);
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		// references
		
		this.getOwnedMember().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.UMLPACKAGE_OWNEDMEMBER));
		
		this.getOwnedType().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.UMLPACKAGE_OWNEDTYPE));
		
		this.getPackageMerge().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.UMLPACKAGE_PACKAGEMERGE));
		
		this.getNestedPackage().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.UMLPACKAGE_NESTEDPACKAGE));
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		// references
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 